package com.shijie.controller;

import com.shijie.dto.JudgeDTO;
import com.shijie.result.SjResult;
import com.shijie.service.JudgeService;
import com.shijie.vo.JudgeVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;


@Slf4j
@RestController
@RequiredArgsConstructor
public class JudgeController {

    private final JudgeService judgeService;

    @PostMapping("/judge")
    public SjResult<JudgeVO> judge(@RequestBody JudgeDTO judgeDTO) {
        log.info("judgeDTO:{}", judgeDTO);
        JudgeVO judgeVO = judgeService.judge(judgeDTO);

        return SjResult.success(judgeVO);
    }

}
